// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity.p_view.WebViews;

import android.content.Context;
import android.os.Handler;
import android.text.ClipboardManager;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.webkit.WebView;
import com.nnee.p_pr.p_activity.p_view.f;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

// Referenced classes of package com.nnee.p_pr.p_activity.p_view.WebViews:
//            c, a, b

public abstract class cls_WebViewAdapter extends cls_WebView
{

    public WebViewAdapter(Context context)
    {
        super(context);
        a = null;
        b = null;
        e = false;
        f = new Handler();
        a(context);
    }

    public WebViewAdapter(Context context, AttributeSet attributeset)
    {
        super(context, attributeset);
        a = null;
        b = null;
        e = false;
        f = new Handler();
        a(context);
    }

    public WebViewAdapter(Context context, AttributeSet attributeset, int i1)
    {
        super(context, attributeset, i1);
        a = null;
        b = null;
        e = false;
        f = new Handler();
        a(context);
    }

    private void a(Context context)
    {
        d = (ClipboardManager)context.getSystemService("clipboard");
    }

    public abstract void a();

    public void a(float f1, float f2)
    {
        if(a != null)
        {
            int ai[] = new int[2];
            getLocationInWindow(ai);
            a.a(this, ai[0] + (int)f1, ai[1] + (int)f2, 0);
        }
    }

    protected void a(int i1, int j1, int k1, int l1)
    {
        if(l == null)
        {
            class cls_aclass[] = new Class[3];
            aclass[0] = Integer.TYPE;
            aclass[1] = Integer.TYPE;
            aclass[2] = Boolean.TYPE;
            l = android/webkit/WebView.getDeclaredMethod("nativeMoveSelection", aclass);
            l.setAccessible(true);
        }
        Object aobj[] = new Object[3];
        aobj[0] = Integer.valueOf(i1);
        aobj[1] = Integer.valueOf(j1);
        aobj[2] = Boolean.valueOf(false);
        l.invoke(this, aobj);
        a(true);
        Method method = l;
        Object aobj1[] = new Object[3];
        aobj1[0] = Integer.valueOf(k1);
        aobj1[1] = Integer.valueOf(l1);
        aobj1[2] = Boolean.valueOf(true);
        method.invoke(this, aobj1);
        c(true);
_L2:
        return;
        Exception exception;
        exception;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public void a(MotionEvent motionevent)
    {
        if(a != null)
        {
            int ai[] = new int[2];
            getLocationInWindow(ai);
            a.a(this, ai[0] + (int)motionevent.getX(), ai[1] + (int)motionevent.getY(), 0);
        }
    }

    public void a(cls_a a1)
    {
        c = a1;
    }

    public void a(cls_b b1)
    {
        b = b1;
    }

    public void a(Runnable runnable)
    {
        if(com.nnee.p_pr.p_activity.p_view.WebViews.c.a())
            f.postDelayed(runnable, 300L);
        else
            runnable.run();
    }

    protected void a(boolean flag)
    {
        if(i == null)
        {
            i = android/webkit/WebView.getDeclaredField("mExtendSelection");
            i.setAccessible(true);
        }
        i.setBoolean(this, flag);
_L2:
        return;
        Exception exception;
        exception;
        if(true) goto _L2; else goto _L1
_L1:
    }

    protected void b(boolean flag)
    {
        if(j == null)
        {
            j = android/webkit/WebView.getDeclaredField("mShiftIsPressed");
            j.setAccessible(true);
        }
        j.setBoolean(this, flag);
_L2:
        return;
        Exception exception;
        exception;
        if(true) goto _L2; else goto _L1
_L1:
    }

    protected void c(boolean flag)
    {
        if(k == null)
        {
            k = android/webkit/WebView.getDeclaredField("mTouchSelection");
            k.setAccessible(true);
        }
        k.setBoolean(this, flag);
_L2:
        return;
        Exception exception;
        exception;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public abstract void d();

    public void destroy()
    {
        super.destroy();
        if(!e)
            e = true;
    }

    public boolean e()
    {
        return false;
    }

    public void f()
    {
        if(a != null)
        {
            a.b();
            a = null;
        }
        if(a == null)
            a = new cls_f(getContext());
        if(c != null)
        {
            a.a();
            c.a(a);
        }
        if(b != null)
            b.b(this);
    }

    public String g()
    {
        d = (ClipboardManager)getContext().getSystemService("clipboard");
        return d.getText().toString();
    }

    public boolean h()
    {
        boolean flag1;
        if(g == null)
        {
            g = android/webkit/WebView.getDeclaredMethod("commitCopy", new Class[0]);
            g.setAccessible(true);
        }
        flag1 = ((Boolean)g.invoke(this, new Object[0])).booleanValue();
        boolean flag = flag1;
_L2:
        return flag;
        Exception exception;
        exception;
        Log.e("WebviewCopy", "Could not copyText ", exception);
        flag = false;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public boolean i()
    {
        boolean flag1;
        if(g == null)
        {
            g = android/webkit/WebView.getDeclaredMethod("copySelection", new Class[0]);
            g.setAccessible(true);
        }
        flag1 = ((Boolean)g.invoke(this, new Object[0])).booleanValue();
        boolean flag = flag1;
_L2:
        return flag;
        Exception exception;
        exception;
        flag = false;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public boolean j()
    {
        boolean flag1;
        if(h == null)
        {
            h = android/webkit/WebView.getDeclaredMethod("selectionDone", new Class[0]);
            h.setAccessible(true);
        }
        flag1 = ((Boolean)h.invoke(this, new Object[0])).booleanValue();
        boolean flag = flag1;
_L2:
        return flag;
        Exception exception;
        exception;
        flag = false;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public void k()
    {
        a(false);
        b(false);
        c(false);
        l();
        invalidate();
    }

    public void l()
    {
        if(a != null)
        {
            a.b();
            a = null;
        }
        if(b != null)
            b.a(this);
    }

    protected boolean m()
    {
        boolean flag1;
        if(j == null)
        {
            j = android/webkit/WebView.getDeclaredField("mShiftIsPressed");
            j.setAccessible(true);
        }
        flag1 = j.getBoolean(this);
        boolean flag = flag1;
_L2:
        return flag;
        Exception exception;
        exception;
        flag = false;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public void n()
    {
        if(m == null)
        {
            m = android/webkit/WebView.getDeclaredMethod("selectText", new Class[0]);
            m.setAccessible(true);
        }
        m.invoke(this, new Object[0]);
_L2:
        return;
        Exception exception;
        exception;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public boolean o()
    {
        boolean flag1;
        if(n == null)
        {
            n = android/webkit/WebView.getDeclaredField("mSelectingText");
            n.setAccessible(true);
        }
        flag1 = Boolean.valueOf(n.getBoolean(this)).booleanValue();
        boolean flag = flag1;
_L2:
        return flag;
        SecurityException securityexception;
        securityexception;
        securityexception.printStackTrace();
_L3:
        flag = false;
        if(true) goto _L2; else goto _L1
_L1:
        NoSuchFieldException nosuchfieldexception;
        nosuchfieldexception;
        nosuchfieldexception.printStackTrace();
          goto _L3
        IllegalArgumentException illegalargumentexception;
        illegalargumentexception;
        illegalargumentexception.printStackTrace();
          goto _L3
        IllegalAccessException illegalaccessexception;
        illegalaccessexception;
        illegalaccessexception.printStackTrace();
          goto _L3
    }

    public boolean onTrackballEvent(MotionEvent motionevent)
    {
        boolean flag;
        if(e())
            flag = true;
        else
            flag = super.onTrackballEvent(motionevent);
        return flag;
    }

    public boolean p()
    {
        android.webkit.WebView.HitTestResult hittestresult = getHitTestResult();
        boolean flag;
        if(hittestresult.getType() != 8 && hittestresult.getType() != 5)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public boolean q()
    {
        return e;
    }

    protected f a;
    protected cls_b b;
    private a c;
    private ClipboardManager d;
    private boolean e;
    private Handler f;
    private Method g;
    private Method h;
    private Field i;
    private Field j;
    private Field k;
    private Method l;
    private Method m;
    private Field n;
}
